package com.dmwork.service.base.exception;

import com.dmwork.common.base.result.ResultCodeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class DmworkException extends RuntimeException {

    private Integer code;

    public DmworkException(String message, Integer code) {
        super(message);
        this.code = code;
    }

    public DmworkException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code=resultCodeEnum.getCode();
    }
}
